require( "glon" );
require( "SQL.lua" );

function query( pl, args )
	
	if args[ 1 ] == "1" then
		//Invetory
		local Query = sql_value_stats( pl, args[ 2 ] );
		if Query != 0 then
			Sendit( tostring( Query ) )
		end
		
	elseif args[ 1 ] == "2" then
		//Skills
		local Query = sql_value_skills( pl, args[ 2 ] );
		if Query != 0 then
			Sendit( tostring( Query ) )
		end
				
	elseif args[ 1 ] == "3" then
		//Stats
		local Query = sql_value_inv( pl );
		if Query != "" then
			Sendit( Query )
		end
	end
	
	//Space resurved for later Server to client communications
	
	
	
	//Now to send the stuff to the client
	function Sendit( Query )
		if Query != "" then
			umsg.Start( "Queryed", pl );
				umsg.String( Query );
			umsg.End();
		end
	end	
	
end

concommand.Add( "query", query );